<%= turbo_frame_tag 'move_all_issues_modal' do %>
  <%= render Modal::DialogComponent.new(
    title: t(".title", grouping: source_grouping.title),
    icon: icon_for(:boards)) do %>

    <div class="space-y-4">
      <p class="text-sm text-base-content">
        <%= t(".description") %>
      </p>

      <div class="flex flex-col items-stretch gap-2 mt-4">
        <% current_visualization.groupings.each do |g| %>
          <% is_current = g == source_grouping %>
          <% unless is_current %>
            <%= link_to move_all_issues_to_visualization_grouping_path(visualization, source_grouping, target_grouping_id: g.id),
              data: { turbo_method: :post },
              class: "btn btn-accent w-full btn-soft justify-between" do %>
                <span>
                  <%= g.title %>
                </span>
                <i class="ti ti-arrow-right ml-auto"></i>
            <% end %>
          <% end %>
        <% end %>
      </div>

      <div class="flex gap-2 justify-center mt-6 pt-4 border-t border-base-200">
        <a class="btn btn-ghost" data-action="click->modal#close">
          <%= t('actions.cancel') %>
        </a>
      </div>
    </div>
  <% end %>
<% end %>